<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>注册 - TisaNote</title>
		<link rel="stylesheet" type="text/css" href="/css/font-awesome.min.css"/>
		<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="/css/login.css">
	</head>
	<body class="login-body">
	    <form class="form-signin" action="/user/registerHandler" method="post">
        <div class="form-signin-heading text-center">
            <h1 class="sign-title">Registration</h1>
            <img src="/images/icon128.png" alt=""/>
        </div>
        <div class="login-wrap">
            <div class="form-group">
                     <div class="input-group" >
                            <span class="input-group-addon"><span class="fa fa-user fa-lg"></span></span>
                            <input id="userName" type="text" class="form-control" name="username" required  placeholder="用户名">
                     </div>
            </div>
           <div class="form-group">
                <div class="input-group" >
                  <span class="input-group-addon"><span class="fa fa-unlock-alt fa-lg" style="width:15px;"></span></span>
                  <input type="password" class="form-control" name="password" id="password_sign" required  placeholder="密码">
                </div>
            </div>
            <div class="form-group">
                <div class="input-group" >
                  <span class="input-group-addon"><span class="fa fa-unlock fa-lg" style="width:15px;"></span></span>
                  <input type="password" class="form-control" name="confirm_password_sign"  id="confirm_password_sign" required  placeholder="确认密码">
                </div>
            </div>
            <button class="btn btn-lg btn-login btn-block" type="submit" onClick="check()">
               <B>注册</B>
            </button>

            <div class="registration">
                Already a member !
                <a class="" href="/user/login">
                    login in
                </a>
            </div>
        </div>
    </form>
    <script>
        function check(){
			var psw1 = document.getElementById("password_sign");
			var psw2 = document.getElementById("confirm_password_sign");
			if(psw1.value!=psw2.value){
				psw2.setCustomValidity("密码和确认密码不一致！");
			}
			else{
				psw2.setCustomValidity("");
			}
		}
    </script>
	</body>
</html>
